#include<iostream>
#include<iomanip>
using namespace std;
int t[1005];
int main()
{
	int n, maxx = -1, minn = 9999999, sum = 0;

	while(cin>>n)
	{
		maxx = -1, minn = 9999999, sum = 0;
		for (int i = 1; i <= n; i++)
		{
			cin >> t[i];
			maxx = max(maxx, t[i]);
			minn = min(minn, t[i]);
			sum += t[i];
		}
		double avg = sum / 2.0;
		if (n == 2)
		{
			cout << fixed << setprecision(1) << minn * 1.0 << endl;
		}
		else if (maxx >= avg)
		{
			cout << fixed << setprecision(1) << (sum - maxx) * 1.0 << endl;
		}
		else if (maxx < avg)
		{
			cout << fixed << setprecision(1) << sum / 2.0 << endl;
		}
	}


	return 0;
}

